var a = []
for(var i = 0;i<10;i++){
    a[i]=function(){
        console.log(i)
    }
}

a[6]()

var b = []
for(let i = 0;i<10;i++){
    b[i]=function(){
        console.log(i)
    }
}
b[6]()
//for和for{}不同作用域
for (let i = 0; i < 3; i++) {
    let i = 'abc';
    console.log(i);
}

//let 不存在变量提升


var tmp = new Date();

function f() {
    console.log(tmp);
    if (false) {
        var tmp = 'hello world';
    }
}

f(); // undefined